package discount

// NoDiscountStrategy 无折扣策略
type NoDiscountStrategy struct {
}

// NewNoDiscountStrategy 无折扣策略
func NewNoDiscountStrategy() DiscountStrategy {
	return &NoDiscountStrategy{}
}

// CalculateDiscount 计算折扣
func (n *NoDiscountStrategy) CalculateTotalAmount(ctx *DiscountContext) float64 {
	total := 0.0
	for _, item := range ctx.Order.Items {
		total += item.Product.Price * float64(item.Quantity)
	}
	return total
}

// Name 策略名称
func (n *NoDiscountStrategy) Name() string {
	return "无折扣"
}
